﻿using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class AssetbundleLoad : MonoBehaviour {

	// Use this for initialization
	IEnumerator Start()
	{
		string path = Application.streamingAssetsPath + "/assetbundles";
		AssetBundle.LoadFromFile(path + "/icon001");
		AssetBundleCreateRequest request = AssetBundle.LoadFromFileAsync(path + "/ui_root");
		yield return request;
		AssetBundle ab = request.assetBundle;
		GameObject obj = Instantiate((GameObject)ab.LoadAsset("preloadframe"));
		obj.name = "preloadframe";
		obj.transform.SetParent(this.transform);
		obj.GetComponent<RectTransform>().anchoredPosition = new Vector2(0, 0);

	}

	// Update is called once per frame
	void Update()
	{

	}
}
